<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>作业3</title>
</head>

<body>
    <script>
        var a = 1;
        var b = 1;
        for (let i = 0; i < 6; i++) {
            document.write(a);
            if (b > a) {
                for (let j = 1; j < b; j++) {
                    document.write(b)
                }
                document.write(a);
            }
            document.write('<br />');
            b++;
        }
    </script>
</body>

</html>